//
/////


#ifndef WEBEFFECTSERVER_H
#define WEBEFFECTSERVER_H

#include <vector>
#include <fstream>
#include <iostream>
#include <string>

using std::string;
using std::ofstream;
using std::vector;
using std::cout;
using std::cin;
using std::endl;

const int NO_FIND = 0;
const int DIRECT_ADDR = 1;
const int PROXY_ADDR = 2;
const int NOEFF_ADDR = 3;
const int NO_IP = 4;

class WebEffectServer
{
public:
	typedef unsigned int TypeStatus;
	WebEffectServer();
	~WebEffectServer();
	bool InitServer();
	void InsertDirectEffectWebAddr(const string &);
	void InsertProxyEffectWebAddr(const string &);
	void InsertNoEffectWebAddr(const string &);
	void InsertNoDnsEffWebAddr(const string &);
	void WriteToFile();
	void WriteDirectVectorToFile();
	void WriteProxyVectorToFile();
	void WriteNoEffVectorToFile();
	void WriteNoDnsEffVectorToFile();
	void EmptyFile();
	void ReadFileRecord();
	int  FindRecordExist(string &);
	void EraseRecord(const string & web_addr);

private:
	string				str_store_file_name;
	vector<string>		direct_eff_vector;
	vector<string>		proxy_eff_vector;
	vector<string>		no_eff_vector;
	vector<string>		no_dns_eff_vector;
	bool				record_flag;

};




#endif